package cn.kgc.day03.mp.controller;

import cn.kgc.day03.mp.entity.User;
import cn.kgc.day03.mp.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 课工场
 * @date 2024/5/29
 * @description
 */
@RestController
@RequestMapping("user")
public class UserController {

    @Resource
    private UserService userService;

    @RequestMapping("list")
    public List<User>  userList(){

        return userService.list();
    }


    @RequestMapping("one")
    public User  getOne(String username){

        return userService.getOne(username);
    }

}
